/**
 * node后台调用java后台接口
 */
module.exports = {
  loginWithOpenId(req) {
    return new Promise((resolve, reject) => {
      ApiService.request(req, ApiConstants.login_loginWithOpenId, {
        openId: req.session.wechat.openid
      }, data => {
        resolve(data)
      })
    })
  },
  toLogOut(req,params){
    return new Promise(resolve => {
      ApiService.request(req, ApiConstants.login_logout, params, data => {
        resolve(data)
      })
    })
  },
  doLogin (req, params) {
    return new Promise(resolve => {
      ApiService.request(req, ApiConstants.login_doLogin, params, data => {
        resolve(data)
      })
    })
  },
}
